package view.graph
{
	import mx.collections.ArrayCollection;

	public class GraphHO extends CustomLineChart
	{
		
		private var _seriseFieldName:Array = ["totalcall_ref","endcall_ref","totalcall","endcall"];
		private var _seriseDisPlayName:Array = ["시도호(지난주)","완료호(지난주)","시도호","완료호"];
		public function GraphHO()
		{
			zeroView = true;
			legendWidth = 332;
			super();
		}
		override public function get seriseFieldName():Array
		{
			return _seriseFieldName;
		}
		override public function get seriseDisPlayName():Array
		{
			return _seriseDisPlayName;
		}
		override public function setGraphData($data:*):void
		{
			if(graphData)
				graphData.removeAll();
			graphData= new ArrayCollection();
			var c:int = 0;
			
			_data = $data;
			if(_data.hasOwnProperty("ho"))
				c = _data.ho.time.length;
			
			maxValue = 0;
			for(var i:int = 0;i<c;i++)
			{
				//_seriseFieldName[i]	
				//var obj:Object = getGraphObject(i);
				maxValue = setMaxValue(maxValue,_data.ho.totalcall[i],_data.ho.endcall[i],_data.ho_ref.totalcall[i],_data.ho_ref.endcall[i]);
					
				var obj:Object = {
							totalcall		: _data.ho.totalcall[i]
						,	endcall			: _data.ho.endcall[i]
						,	totalcall_ref	: _data.ho_ref.totalcall[i]
						,	endcall_ref		: _data.ho_ref.endcall[i]
						,	time			: _data.ho.time[i]
				}; 
				graphData.addItem(obj)
			}
			
			drawGraph();
		}
	}
}